<script setup lang= 'ts'>
import type { SearchResult } from '@/services/type'

interface Props {
  list: SearchResult[]
}
interface Emits {
  change: [val: string]
}

const emits = defineEmits<Emits>()
const props = defineProps<Props>()


</script>

<template>
  <uni-section title="搜索建议" type="line" />
  <view
    class="item"
    v-for="(item, index) in props.list"
    :key="item.id"
    @click="emits('change', item.keyword)"
  >
    {{ item.keyword }}
  </view>
</template>

<style scoped scss>
.item {
  height: 50px;
  line-height: 50px;
  padding-left: 10px;
  border-bottom: 1px dashed #ccc;
}
.uni-section ::v-deep  .uni-section-header__decoration{
  background-color: rgb(236, 117, 117);
}
</style>
